<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Irrlicht 3D Engine: irr::video::IMaterialRenderer Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Irrlicht 3D Engine
   
   </div>
   
  </td>
  
  
  
   
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
   
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classirr_1_1video_1_1_i_material_renderer.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">irr::video::IMaterialRenderer Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="irr::video::IMaterialRenderer" --><!-- doxytag: inherits="irr::IReferenceCounted" -->
<p>Interface for material rendering.  
 <a href="classirr_1_1video_1_1_i_material_renderer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for irr::video::IMaterialRenderer:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
 <div class="center">
  <img src="classirr_1_1video_1_1_i_material_renderer.png" usemap="#irr::video::IMaterialRenderer_map" alt=""/>
  <map id="irr::video::IMaterialRenderer_map" name="irr::video::IMaterialRenderer_map">
<area href="classirr_1_1_i_reference_counted.html" title="Base class of most objects of the Irrlicht Engine." alt="irr::IReferenceCounted" shape="rect" coords="0,0,170,24"/>
</map>
 </div></div>

<p><a href="classirr_1_1video_1_1_i_material_renderer-members.html">List of all members.</a></p>
<h2><a name="pub-methods"></a>
Public Member Functions</h2>
<ul>
<li>virtual <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> <a class="el" href="classirr_1_1video_1_1_i_material_renderer.html#a8ccaf22f84f26a718559d3c97f7cb550">getRenderCapability</a> () const 
<dl class="el"><dd class="mdescRight">Returns the render capability of the material.  <a href="#a8ccaf22f84f26a718559d3c97f7cb550"></a><br/></dl><li>virtual bool <a class="el" href="classirr_1_1video_1_1_i_material_renderer.html#a31ba4c2c50b85327d328cb9e7b1764bd">isTransparent</a> () const 
<dl class="el"><dd class="mdescRight">Returns if the material is transparent.  <a href="#a31ba4c2c50b85327d328cb9e7b1764bd"></a><br/></dl><li>virtual bool <a class="el" href="classirr_1_1video_1_1_i_material_renderer.html#a8cb6c5f93856de7586a318f14ed21a22">OnRender</a> (<a class="el" href="classirr_1_1video_1_1_i_material_renderer_services.html">IMaterialRendererServices</a> *service, <a class="el" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deac">E_VERTEX_TYPE</a> vtxtype)
<dl class="el"><dd class="mdescRight">Called every time before a new bunch of geometry is being drawn using this material with for example drawIndexedTriangleList() call.  <a href="#a8cb6c5f93856de7586a318f14ed21a22"></a><br/></dl><li>virtual void <a class="el" href="classirr_1_1video_1_1_i_material_renderer.html#aeaffc03c1b9feb40cd01469726b287e3">OnSetMaterial</a> (const <a class="el" href="classirr_1_1video_1_1_s_material.html">SMaterial</a> &amp;material, const <a class="el" href="classirr_1_1video_1_1_s_material.html">SMaterial</a> &amp;lastMaterial, bool resetAllRenderstates, <a class="el" href="classirr_1_1video_1_1_i_material_renderer_services.html">IMaterialRendererServices</a> *services)
<dl class="el"><dd class="mdescRight">Called by the <a class="el" href="classirr_1_1video_1_1_i_video_driver.html" title="Interface to driver which is able to perform 2d and 3d graphics functions.">IVideoDriver</a> implementation the let the renderer set its needed render states.  <a href="#aeaffc03c1b9feb40cd01469726b287e3"></a><br/></dl><li>virtual void <a class="el" href="classirr_1_1video_1_1_i_material_renderer.html#a694b1285671853cb151c03100fd01c73">OnUnsetMaterial</a> ()
<dl class="el"><dd class="mdescRight">Called by the <a class="el" href="classirr_1_1video_1_1_i_video_driver.html" title="Interface to driver which is able to perform 2d and 3d graphics functions.">IVideoDriver</a> to unset this material.  <a href="#a694b1285671853cb151c03100fd01c73"></a><br/></dl></ul>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Interface for material rendering. </p>
<p>Can be used to extend the engine with new materials. Refer to <a class="el" href="classirr_1_1video_1_1_i_video_driver.html#a0dfc3a7168f3a73a6f4323b579f03ff6" title="Adds a new material renderer to the video device.">IVideoDriver::addMaterialRenderer()</a> for more informations on how to extend the engine with new materials. </p>

<p>Definition at line <a class="el" href="_i_material_renderer_8h_source.html#l00024">24</a> of file <a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a8ccaf22f84f26a718559d3c97f7cb550"></a><!-- doxytag: member="irr::video::IMaterialRenderer::getRenderCapability" ref="a8ccaf22f84f26a718559d3c97f7cb550" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> irr::video::IMaterialRenderer::getRenderCapability </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the render capability of the material. </p>
<p>Because some more complex materials are implemented in multiple ways and need special hardware capabilities, it is possible to query how the current material renderer is performing on the current hardware with this function. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns 0 if everything is running fine. Any other value is material renderer specific and means for example that the renderer switched back to a fall back material because it cannot use the latest shaders. More specific examples: Fixed function pipeline materials should return 0 in most cases, parallax mapped material will only return 0 when at least pixel shader 1.4 is available on that machine. </dd></dl>

<p>Definition at line <a class="el" href="_i_material_renderer_8h_source.html#l00093">93</a> of file <a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a>.</p>

</div>
</div>
<a class="anchor" id="a31ba4c2c50b85327d328cb9e7b1764bd"></a><!-- doxytag: member="irr::video::IMaterialRenderer::isTransparent" ref="a31ba4c2c50b85327d328cb9e7b1764bd" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool irr::video::IMaterialRenderer::isTransparent </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns if the material is transparent. </p>
<p>The scene managment needs to know this for being able to sort the materials by opaque and transparent. </p>

<p>Definition at line <a class="el" href="_i_material_renderer_8h_source.html#l00081">81</a> of file <a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8cb6c5f93856de7586a318f14ed21a22"></a><!-- doxytag: member="irr::video::IMaterialRenderer::OnRender" ref="a8cb6c5f93856de7586a318f14ed21a22" args="(IMaterialRendererServices *service, E_VERTEX_TYPE vtxtype)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool irr::video::IMaterialRenderer::OnRender </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classirr_1_1video_1_1_i_material_renderer_services.html">IMaterialRendererServices</a> *&#160;</td>
          <td class="paramname"><em>service</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deac">E_VERTEX_TYPE</a>&#160;</td>
          <td class="paramname"><em>vtxtype</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called every time before a new bunch of geometry is being drawn using this material with for example drawIndexedTriangleList() call. </p>
<p>OnSetMaterial should normally only be called if the renderer decides that the renderstates should be changed, it won't be called if for example two drawIndexedTriangleList() will be called with the same material set. This method will be called every time. This is useful for example for materials with shaders, which don't only set new renderstates but also shader constants. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">service,:</td><td>Pointer to interface providing methos for setting constants and other things. </td></tr>
    <tr><td class="paramname">vtxtype,:</td><td>Vertex type with which the next rendering will be done. This can be used by the material renderer to set some specific optimized shaders or if this is an incompatible vertex type for this renderer, to refuse rendering for example. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns true if everything is ok, and false if nothing should be rendered. The material renderer can choose to return false for example if he doesn't support the specified vertex type. This is actually done in D3D8 and D3D9 when using a normal mapped material with a vertex type other than EVT_TANGENTS. </dd></dl>

<p>Definition at line <a class="el" href="_i_material_renderer_8h_source.html#l00071">71</a> of file <a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a>.</p>

</div>
</div>
<a class="anchor" id="aeaffc03c1b9feb40cd01469726b287e3"></a><!-- doxytag: member="irr::video::IMaterialRenderer::OnSetMaterial" ref="aeaffc03c1b9feb40cd01469726b287e3" args="(const SMaterial &amp;material, const SMaterial &amp;lastMaterial, bool resetAllRenderstates, IMaterialRendererServices *services)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void irr::video::IMaterialRenderer::OnSetMaterial </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classirr_1_1video_1_1_s_material.html">SMaterial</a> &amp;&#160;</td>
          <td class="paramname"><em>material</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classirr_1_1video_1_1_s_material.html">SMaterial</a> &amp;&#160;</td>
          <td class="paramname"><em>lastMaterial</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>resetAllRenderstates</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1video_1_1_i_material_renderer_services.html">IMaterialRendererServices</a> *&#160;</td>
          <td class="paramname"><em>services</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called by the <a class="el" href="classirr_1_1video_1_1_i_video_driver.html" title="Interface to driver which is able to perform 2d and 3d graphics functions.">IVideoDriver</a> implementation the let the renderer set its needed render states. </p>
<p>This is called during the <a class="el" href="classirr_1_1video_1_1_i_video_driver.html#a8c9e31b41b7e6fd26cf65ce538ebab05" title="Sets a material.">IVideoDriver::setMaterial()</a> call. When overriding this, you can set some renderstates or for example a vertex or pixel shader if you like. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">material,:</td><td>The new material parameters to be set. The renderer may change the material flags in this material. For example if this material does not accept the zbuffer = true, it can set it to false. This is useful, because in the next lastMaterial will be just the material in this call. </td></tr>
    <tr><td class="paramname">lastMaterial,:</td><td>The material parameters which have been set before this material. </td></tr>
    <tr><td class="paramname">resetAllRenderstates,:</td><td>True if all renderstates should really be reset. This is usually true if the last rendering mode was not a usual 3d rendering mode, but for example a 2d rendering mode. You should reset really all renderstates if this is true, no matter if the lastMaterial had some similar settings. This is used because in most cases, some common renderstates are not changed if they are already there, for example bilinear filtering, wireframe, gouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and fogenable. </td></tr>
    <tr><td class="paramname">services,:</td><td>Interface providing some methods for changing advanced, internal states of a <a class="el" href="classirr_1_1video_1_1_i_video_driver.html" title="Interface to driver which is able to perform 2d and 3d graphics functions.">IVideoDriver</a>. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_i_material_renderer_8h_source.html#l00050">50</a> of file <a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a>.</p>

</div>
</div>
<a class="anchor" id="a694b1285671853cb151c03100fd01c73"></a><!-- doxytag: member="irr::video::IMaterialRenderer::OnUnsetMaterial" ref="a694b1285671853cb151c03100fd01c73" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void irr::video::IMaterialRenderer::OnUnsetMaterial </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called by the <a class="el" href="classirr_1_1video_1_1_i_video_driver.html" title="Interface to driver which is able to perform 2d and 3d graphics functions.">IVideoDriver</a> to unset this material. </p>
<p>Called during the <a class="el" href="classirr_1_1video_1_1_i_video_driver.html#a8c9e31b41b7e6fd26cf65ce538ebab05" title="Sets a material.">IVideoDriver::setMaterial()</a> call before the new material will get the <a class="el" href="classirr_1_1video_1_1_i_material_renderer.html#aeaffc03c1b9feb40cd01469726b287e3" title="Called by the IVideoDriver implementation the let the renderer set its needed render states...">OnSetMaterial()</a> call. </p>

<p>Definition at line <a class="el" href="_i_material_renderer_8h_source.html#l00076">76</a> of file <a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_i_material_renderer_8h_source.html">IMaterialRenderer.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceirr.html">irr</a>      </li>
      <li class="navelem"><a class="el" href="namespaceirr_1_1video.html">video</a>      </li>
      <li class="navelem"><a class="el" href="classirr_1_1video_1_1_i_material_renderer.html">IMaterialRenderer</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht 
Engine</a> Documentation &copy; 2003-2012 by Nikolaus Gebhardt. Generated on Sat Jul 9 2016 18:18:44 for Irrlicht 3D Engine by
<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
